The Internet is a world-wide network of cooperating computer networks. Connected to the cooperating network of computer networks which make up the Internet are thousands of individual computers. The individual computers use network protocols to communicate with other computers connected to the Internet. A network protocol is a set of rules defining how a computer can "talk" to another computer. Computers connected to the Internet typically use the Transmission Control Protocol (TCP) and the Internet Protocol (IP) protocol suite to communicate.
TCP/IP is a layered set of protocols which is conceptualized as being stacked vertically into layers. TCP is a transport layer that defines data flow, acknowledges data, and retransmits lost or damaged data. However, the User Datagram Protocol (UDP) is also commonly used as a transport layer in place of TCP. IP is a network layer that defines the format of data and the basic unit of data transfer. TCP/IP provides a reliable, byte-stream-oriented virtual circuit for data transfer and is known in the art. There are also higher level application protocols in the Internet protocol suite including File Transfer Protocol (FTP), Simple Mail Transfer Protocol (SMTP), Hyper Text Transfer Protocol (HTTP), Gopher, etc. which use TCP/IP to pass data across the Internet.
From a user's point of view, access to the Internet and its services typically are accomplished by invoking application programs (e.g., Internet browsers, e-mail, etc.). The application programs act as an interface between a user and the Internet. The application programs are "client" programs that accept commands from the user and obtain Internet information and services by sending requests to "server" programs on another computer at some other location on the Internet. With the increasing popularity and accessibility of the Internet, a wide variety of application programs such as word processors, personal finance managers, and spreadsheets, etc., are emerging with embedded Internet access software or functionality.
Creating application programs which act as an interface between a user and the Internet is not a trivial task and presents a number of difficult problems. An Internet application program must recognize, understand, and properly handle all of the details of multiple application protocols in the Internet protocol suite (e.g., HTTP, FTP, Gopher, etc.). Internet application protocols typically communicate with the underlying protocols (e.g., TCP/IP) through software communication facilities (e.g., sockets). These communication facilities as well as the underlying protocols must also be managed by an application.
To provide the necessary functionality for a user, the application program must a manage a large number of details for the Internet application protocols, communication facilities, and underlying protocols, including establishing/terminating connections, filing data structures, setting flags, setting timers, creating data packets, sequencing data, sending/receving data, error handling for bad or incomplete data, etc.
If multiple simultaneous Internet application protocol connections are desired (e.g., HTTP and an FTP connection), then the application program must manage the large number of details for each of the multiple connections. If security features are desired (e.g., encryption, secure sockets layer (SSL), etc.) then the application program must also handle the security details.
If a new Internet protocol or communication facility is desired, new source code must be added to the application program. If an existing Internet protocol or communication facility is changed to comply with an evolving standard or the addition of an advanced feature (as is common in the rapidly changing Internet environment), the source code for the application program must be modified at a number of different levels to comply with the desired changes.
As is known in the art, networking function can be created and stored in standard function libraries, such as the "libwww.ext" (e.g., "libwww.lib" for the Windows operating system, "libwww.a" for the UNIX.RTM. operating system, etc.) by the Worldwide Web (W3) Consortium at the Massachusetts Institute of Technology, in Cambridge, Mass.
Such standard networking libraries are linked to an application program to provide networking functionality. However, standard function libraries known in the art are typically not reentrant. Reentrant functions are functions that can be repeatedly called from one or more application program without interference.
Every application program which desires to use the standard function library links in its own copy of the function library. This significantly increases the overall size of the application program, and may result in multiple copies of the same function library linked to a number of different application programs which wastes a significant amount of computer resources (e.g., memory, secondary storage, etc.).
As a result, the application programs are very complex and very costly to develop. In addition, this complex application program code is often hard to modify without introducing new or additional software defects, and is very difficult to debug after modifications are made.
In accordance with a preferred embodiment of the present invention, problems associated with creating application programs which access the Internet and other computer networks are overcome. An Internet application program interface (API) (which will be explained in detail below) including a set of reentrant Internet-specific functions is used. The reentrant functions in the Internet API reside in a dynamic link library (DLL) which is used by multiple application programs. There is typically only one copy of the Internet API DLL on any computer, and all application programs which need to contact a computer network like the Internet use the same reentrant function calls stored in the DLL. In contrast, a copy of a non-reentrant networking function would reside in every application program that needed it, and the non-reentrant function in a given application program could not be called by any other application program.
The reentrant Internet API functions also eliminate the need to embed source code directly in an application program to manage Internet application protocols (e.g., HTTP, FTP, Gopher, etc), communication facilities (e.g., sockets) or the underlying protocols (e.g., TCP/IP).
The reentrant Internet functions provided by the Internet API of the present invention manage connection to and communication with the Internet for the application program. The reentrant Internet functions comply with standard API programming standards and treat arguments and errors in a consistent manner. The reentrant functions provide a clean and concise interface to the Internet or other computer networks (e.g., a Local Area Network or intranet) for an application program. The reentrant functions use file system semantics (e.g., InternetOpenUrl().apprxeq.OpenFile(), InternetReadFile().apprxeq.ReadFile(), etc.) and have a logical syntax, functionality, structure and organization that parallels file system operations that are well known in the art. The file system semantics used by the Internet API abstract a large number of network connection details to a level of file system commands. This is not the case for other libraries of networking functions such as the "libwww.ext" described above. The other libraries require a developer to become familiar with a large number of unique function call names to use the networking functions.
The Internet API functions are also provide a hierarchical relationship between the functions. The function hierarchy is the result defining a number of independent and dependent function levels, where the functions at each level return Internet handles. A Internet handle is an index into an application specific object table. The Internet handles returned at level-N are used to call the Internet API functions on level-N-1. The function hierarchy provides a concise way to manage a large number of networking details by propagating access to networking data to the next lower function level through the Internet handle, thereby eliminating a significant amount of data management overhead. The function hierarchy and Internet handles will be explained in detail below.
As an example, suppose an Internet application program is to open an FTP session with a remote server application at a desired location on the Internet. In the preferred embodiment of the present invention, calls to two of the reentrant Internet API functions (e.g., InternetOpen(. . . ),InternetConnect(. . . ,FTP, . . . ), which will be explained in detail below) will initialized an Internet session, establish a connection, and manage all the underlying details including the FTP protocol, the communication facilities required (e.g., a socket connection), and the underlying protocols (e.g., TCP/IP) to establish communications with a remote server application on a remote computer connected to the Internet. The Internet application program does not have to include source code to establish an Internet connection, handle the FTP protocol, the communications facilities, or the underlying protocols. All of these details are abstracted in the Internet API and are hidden from or transparent to the application program.
The reentrant Internet API functions also provide built-in security features and asynchronous operations. An Internet application program can use the security features (e.g., encrypt data, use a proxy application as a "firewall, etc.) by setting parameters and calling selected Internet API functions. Many of the reentrant. Internet API functions can be used in an asynchronous mode of operation. In a synchronous mode of operation, an application program makes a function call, and then waits for the completion of the function call before it can continue executing. In an asynchronous mode of operation, an application program makes a function call and immediately continues executing other program operations. When the asynchronous function call operations are complete, the application program is contacted and can then process any data returned from the asynchronous function call. The use of asynchronous operations dramatically improves the operation of application programs which provide user interfaces (e.g., an Internet browser). Since the application program is not blocked while waiting for an asynchronous function call to complete, it can continue to interact with a user.
If an existing Internet protocol or communication facility is modified or evolved, an application program which uses the Internet API will require minimal or possibly no modifications. The reentrant Internet API functions would instead be modified, and the details of the changes would not be visible to, and need not be incorporated in, the application program. If a new Internet protocol, communication facility, etc. is added, the application would require minimal modification (e.g., adding a new argument to an existing re-entrant Internet API function call or calling a new Internet API function).
The reentrant functions in the Internet API allow application programs to be written for the Internet without large amounts of source code to manage the details of Internet application protocols, communications facilities and underlying protocols. The Internet API functions allow a developer to focus on the development of a specific application program, instead of spending a large amount of time handling Internet connection details. As a result, Internet application programs are less complex, less costly to develop, smaller in size, and easier to modify if new functionality is desired since most of the Internet details an application program typically needs to manage are handled by the Internet API functions. In addition the Internet API functions can also be used for intranet applications for establishing communications with a variety of computer networks.
The foregoing and other features and advantages of the preferred embodiment of the present invention will be more readily apparent from the following detailed description, which proceeds with reference to the accompanying drawings.